package com.yznote.compileserver.config;

import com.jcraft.jsch.JSch;
import com.yznote.compileserver.terminal.TerminalSession;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ConcurrentHashMap;

@Configuration
public class YCompileConfig {
    @Bean
    public Runtime runtime(){
        return Runtime.getRuntime();
    }
    @Bean
    public JSch jSch(){
        JSch.setConfig("StrictHostKeyChecking","no");
        return new JSch();
    }
    @Bean
    public ConcurrentHashMap<Long, TerminalSession> sessionPool(){
        return new ConcurrentHashMap<>();
    }
}
